package com.cc.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author 86130
 * @version 1.0
 * @description: TODO
 * @date 2025/5/26 下午2:06
 */
public class DateUtil {
    //将String转成Date类型
    public static Date StringToDate(String dateTime){
        String format = "yyyy-MM-dd";
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        Date date = null;
        try {
            //将字符串解析为日期类型
            date = sdf.parse(dateTime);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return date;
    }
}
